export default {
    setTiem(key, val) {
        let storage = this.getStorage()
        storage[key] = val
        window.sessionStorage.setItem(key,JSON.stringify(storage))
    },
    setTOP_obj(key,value) {
        console.log(this.getStorage()[key])
    },
    getItem(key) {
        return this.getStorage()[key]
    },
    getStorage() {
        return JSON.parse(window.sessionStorage.getItem(process.env.VUEX_NAMESPACE)||"{}")
    },
    clearItem(key) {
        let storage = this.getStorage()
        delete storage[key]
        window.sessionStorage.setItem(process.env.VUEX_NAMESPACE,JSON.stringify(storage))
    },
    clearAll() {
        window.sessionStorage.clear()
    }
}